home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 6.6 KB | 242 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: SLStrmRW.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
- #ifndef SLSTRMRW_H
- #define SLSTRMRW_H
-
-
- #ifndef FWODEXCE_H
- #include "FWODExce.h"
- #endif
-
- #ifndef FWSOMENV_H
- #include "FWSOMEnv.h"
- #endif
-
- // Export or Import functions for CFM-68K [sfu]
-
- #if defined(FW_ODFLIB_IMPORT)
- #pragma import on
- #elif defined(FW_ODFLIB)
- #pragma export on
- #endif
-
- FW_EXTERN_C_BEGIN
-
- //========================================================================================
- // Forward class declarations
- //========================================================================================
-
- class FW_OSink;
- class FW_OObjectRegistry;
-
-
- //========================================================================================
- // STRUCT FW_SReadableStream
- //========================================================================================
-
- struct FW_SReadableStream;
- typedef FW_SReadableStream* FW_HReadableStream;
- struct FW_SReadableStream
- {
- FW_OSink* fSink;
- FW_OObjectRegistry* fObjectRegistry;
- Environment fev;
-
- void* fReserved;
-
- int fNumberFormat;
- FW_Boolean fArchiveCreatedObjectRegistry;
- };
-
-
-
- //========================================================================================
- // FW_SReadableStream Member Functions
- //========================================================================================
-
-
- FW_PlatformError SL_API
- FW_PrivReadableStream_Construct(FW_HReadableStream stream,
- FW_OSink* sink,
- FW_OObjectRegistry* objectRegistry,
- int numberFormat);
- // Construct the instance.
-
- FW_PlatformError SL_API
- FW_PrivReadableStream_CopyConstruct(FW_HReadableStream stream,
- FW_HReadableStream original);
- // Construct the instance.
-
- FW_PlatformError SL_API
- FW_PrivReadableStream_Destruct(FW_HReadableStream stream);
- // Destruct the instance.
-
- FW_PlatformError SL_API
- FW_PrivReadableStream_ReadBytes(FW_HReadableStream stream,
- void* buffer,
- long count);
- // Read 'count' bytes into buffer.
-
- FW_PlatformError SL_API
- FW_PrivReadableStream_ReadChars(FW_HReadableStream stream,
- char* buffer,
- long count);
- // Read 'count' chars into buffer.
-
- FW_PlatformError SL_API
- FW_PrivReadableStream_ReadNullTerminatedString(FW_HReadableStream stream,
- char* nullTerminatedString);
- // Read a null-terminated string.
-
- FW_PlatformError SL_API
- FW_PrivReadableStream_ReadShorts(FW_HReadableStream stream,
- short* buffer,
- long count);
- // Read 'count' shorts into buffer.
-
- FW_PlatformError SL_API
- FW_PrivReadableStream_ReadLongs(FW_HReadableStream stream,
- long* buffer,
- long count);
- // Read 'count' longs into buffer.
-
- FW_PlatformError SL_API
- FW_PrivReadableStream_ReadFloats(FW_HReadableStream stream,
- float* buffer,
- long count);
- // Read 'count' floats into buffer.
-
- FW_PlatformError SL_API
- FW_PrivReadableStream_ReadDoubles(FW_HReadableStream stream,
- double* buffer,
- long count);
- // Read 'count' doubles into buffer.
-
-
- //----------------------------------------------------------------------------------------
- // FW_PrivReadableStream_ReadInts
- //----------------------------------------------------------------------------------------
-
- inline FW_PlatformError FW_PrivReadableStream_ReadInts(FW_HReadableStream stream,
- int* buffer,
- long count)
- {
- #if FW_FOUR_BYTE_INTS
- return FW_PrivReadableStream_ReadLongs(stream, (long*)buffer, count);
- #else
- return FW_PrivReadableStream_ReadShorts(stream, (short*)buffer, count);
- #endif
- }
-
-
- //========================================================================================
- // STRUCT FW_SWritableStream
- //========================================================================================
-
- struct FW_SWritableStream;
- typedef FW_SWritableStream* FW_HWritableStream;
- struct FW_SWritableStream
- {
- FW_OSink* fSink;
- FW_OObjectRegistry* fObjectRegistry;
- Environment fev;
-
- void* fReserved;
-
- int fNumberFormat;
- FW_Boolean fArchiveCreatedObjectRegistry;
- };
-
-
- FW_PlatformError SL_API
- FW_PrivWritableStream_Construct(FW_HWritableStream stream,
- FW_OSink* sink,
- FW_OObjectRegistry* objectRegistry,
- int numberFormat);
- // Construct the instance.
-
- FW_PlatformError SL_API
- FW_PrivWritableStream_CopyConstruct(FW_HWritableStream stream,
- FW_HWritableStream original);
- // Construct the instance.
-
- FW_PlatformError SL_API
- FW_PrivWritableStream_Destruct(FW_HWritableStream stream);
- // Destruct the instance.
-
- FW_PlatformError SL_API
- FW_PrivWritableStream_WriteBytes(FW_HWritableStream stream,
- const void* buffer,
- long count);
- // Write 'count' bytes from buffer.
-
- FW_PlatformError SL_API
- FW_PrivWritableStream_WriteChars(FW_HWritableStream stream,
- const char* buffer,
- long count);
- // Write 'count' chars from buffer.
-
- FW_PlatformError SL_API
- FW_PrivWritableStream_WriteNullTerminatedString(FW_HWritableStream stream,
- const char* buffer);
- // Write a null terminated string.
-
- FW_PlatformError SL_API
- FW_PrivWritableStream_WriteShorts(FW_HWritableStream stream,
- const short* buffer,
- long count);
- // Write 'count' shorts from buffer.
-
- FW_PlatformError SL_API
- FW_PrivWritableStream_WriteLongs(FW_HWritableStream stream,
- const long* buffer,
- long count);
- // Write 'count' longs from buffer.
-
- FW_PlatformError SL_API
- FW_PrivWritableStream_WriteFloats(FW_HWritableStream stream,
- const float* buffer,
- long count);
- // Write 'count' floats from buffer.
-
- FW_PlatformError SL_API
- FW_PrivWritableStream_WriteDoubles(FW_HWritableStream stream,
- const double* buffer,
- long count);
- // Write 'count' doubles from buffer.
-
-
- //----------------------------------------------------------------------------------------
- // FW_PrivWritableStream_WriteInts
- //----------------------------------------------------------------------------------------
-
- inline FW_PlatformError FW_PrivWritableStream_WriteInts(FW_HWritableStream stream,
- const int* buffer,
- long count)
- {
- #if FW_FOUR_BYTE_INTS
- return FW_PrivWritableStream_WriteLongs(stream, (const long*)buffer, count);
- #else
- return FW_PrivWritableStream_WriteShorts(stream, (const short*)buffer, count);
- #endif
- }
-
-
- FW_EXTERN_C_END
-
- // For CFM-68K [sfu]
-
- #if defined(FW_ODFLIB_IMPORT)
- #pragma import off
- #elif defined(FW_ODFLIB)
- #pragma export off
- #endif
-
- #endif
-